import RNFS from 'react-native-fs';
import { isIOS } from '../../constant';

export const DOWNLOAD_PATH = `${
  isIOS ? RNFS.DocumentDirectoryPath : RNFS.ExternalDirectoryPath
}/videos`;

export enum VIDEO_TYPE {
  ld = 0,
  sd = 1,
  hd = 2
}

export const DOWNLOAD_TAG = 'downloadVideoTaskLog';

export const DOWNLOAD_MANAGE_TAG = 'manageDownloadVideoTaskLog';

export const VIDEO_TYPE_DESC = ['ld', 'sd', 'hd'];

export const VIDEO_TYPE_NUMBER_DESC = ['270P', '480P', '720P'];

export const DOWNLOAD_VIDEO_TASK_START = 'downloadVideoTaskStart';

export const DOWNLOAD_VIDEO_TASK_PROGRESS = 'downloadVideoTaskProgress';

export const DOWNLOAD_VIDEO_TASK_SUCCESS = 'downloadVideoTaskSuccess';

export const DOWNLOAD_VIDEO_TASK_PAUSE = 'downloadVideoTaskPause';

export const DOWNLOAD_VIDEO_TASK_DELETE = 'downloadVideoTaskDelete';

export const DOWNLOAD_VIDEO_TASK_FAIL = 'downloadVideoTaskFail';

export const DOWNLOAD_VIDEO_TASK_CAN_PLAY = 'downloadVideoTaskCanPlay';

export const DOWNLOAD_VIDEO_TASK_INIT_CAN_PLAY = 'downloadVideoTaskInitCanPlay';

export const M3U8_FAIL_LIMIT = 10;

export const TS_FAIL_LIMIT = 200;

export const MOST_TASK_NUM = 2;

export const GET_VIDEO_TOKEN_DEV =
  'http://devapi.mifengxiaoban.com/v2/video/get/';

export const GET_VIDEO_TOKEN_PROD =
  'https://api.mifengxiaoban.com/v2/video/get/';

export const INIT_CAN_PLAY_TS_NUM = 4;

export const INIT_CAN_PLAY_PROGRESS = 0.3;
